﻿@model Tasks.UI.Models.Account.PersonalManageModel
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link href="@Config.GetCssResourcePath("main.css")" rel="stylesheet" type="text/css" />
    <link href="@Config.GetCssResourcePath("table.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/global.js")" type="text/javascript"></script>
    <script type="text/javascript">

        //init
        $(function () {
            initProvince("#ProvinceID");
            initCity("#CityID");

            $(".searchBar").advSwitch();
            aaa();
        })
        //删除
        function deletePersonalMember(UserID) {
            $("#UserID").val(UserID);
            $("#act").val("delete");
            $("#form1").submit();
        }
        //禁用
        function disablePersonalMember(UserID) {
            $("#UserID").val(UserID);
            $("#act").val("disable");
            $("#form1").submit();
        }
        //启用
        function enablePersonalMember(UserID) {
            $("#UserID").val(UserID);
            $("#act").val("enable");
            $("#form1").submit();
        }
   
    </script>
</head>
<body>
  <form action="PersonalMemberManage" method="post" id="form1">
    <input id="UserID" name="UserID" type="hidden" />
    <input id="act" name="act" type="hidden" />
    <div id="container">
        <div class="navTitle">
            <ul>
                <li class="Home SecondLast"><a href="index.php">
                    <div class="HomeIcon">
                    </div>
                    <font><font>Home</font></font></a></li><li class="Last"><span><font><font>个人会员管理</font></font></span></li>
            </ul>
        </div>
        <h1>
            <font><font class="">查看：</font></font><a href="#" style="color: #005FA3" id="ViewsMenuButton"
                class="PopDownMenu"><font><font class="">所有个人会员</font></font><img width="8" height="5"
                    src="/images/arrow_blue.gif" border="0"></a>
        </h1>
        <p class="intro">
            <font><font>你的会员如下。</font><font class="">点击“添加会员”按钮来添加一个新的会员。 </font></font>
        </p>
        <div class="searchBar">
            <div class="box">
                <table>
                    <tr>
                        <td style="width: 50px;">
                            <strong>姓名：</strong>
                        </td>
                        <td style="width: 160px;">
                            @Html.TextBoxFor(t => t.Name)
                        </td>
                        <td style="width: 50px;">
                            <strong>手机： </strong>
                        </td>
                        <td>@Html.TextBoxFor(t => t.MobileNo)
                            <span class="unadv">
                                <input id="btnSearch" type="submit" value="查询" class="btnSearch" />
                              </span>
                        </td>
                    </tr>
                    <tr class="adv">
                        <td>
                            <strong>客户类别： </strong>
                        </td>
                        <td>@Html.DropDownList("CategoryID", PageHelper.Per_Member_Cat(Model.CategoryID), new { style = "width:100px" })
                        </td>
                        <td>
                            <strong>地区： </strong>
                        </td>
                        <td>
                            @Html.DropDownList("ProvinceID", PageHelper.ProvinceSelector(Model.ProvinceID), new { style = "width:70px" })
                            @Html.DropDownList("CityID", PageHelper.CitySelector(Model.CityID, Model.ProvinceID), new { style = "width:70px" })
                            @Html.DropDownList("AreaID", PageHelper.AreaSelector(Model.AreaID, Model.CityID), new { style = "width:70px" })
                        </td>
                    </tr>
                    <tr class="adv">
                        <td>
                            <strong>客户来源： </strong>
                        </td>
                        <td>@Html.DropDownList("SourceID", PageHelper.Per_Member_Source(Model.SourceID), new { style = "width:100px" })
                        </td>
                    </tr>
                    <tr class="adv">
                        <td>
                        </td>
                        <td>
                            <input id="btnRefresh" type="submit" value="查询" class="btnSearch" />
                           
                        </td>
                    </tr>
                </table>
                <div class="bottom">
                </div>
            </div>
        </div>
        <div class="cpsoso">
            <div class="cpsosofenye">
            </div>
            <div class="cpsosoleft">
                <a href="javascript:void(0)" onclick="openTab('编辑个人会员信息','/Account/EditPersonalMember',true)"><span>
                    新增个人会员</span></a>
                    
                     或
                <select name="select" id="select">
                    <option>- 选择动作 - </option>
                    <option>删除选定</option>
                </select>
                <a href="javascript:void(0)"><span>去</span></a></div>
        </div>
        <div class="pageBody">
            <table class="tblStyle1" style="table-layout: fixed;">
                <thead>
                    <tr>
                        <th style="width: 10%;">
                            账户状态
                        </th>
                        <th style="width: 15%;">
                            姓名
                        </th>
                        <th style="width: 15%;">
                            账户
                        </th>
                        <th style="width: 15%;">
                            年龄
                        </th>
                        <th style="width: 15%;">
                            手机号码
                        </th>
                        <th style="width: 15%;">
                            最后登录
                        </th>
                      <th style="width: 15%;">
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (PersonalMember member in Model.accountlist)
                    {
                        <tr align="center">
                            <td>
                                @if (member.PersonalMemberState == 1)
                                {
                                    @Html.Label("有效");
                                }
                                else
                                {
                                    @Html.Label("无效");
                                }
                            </td>
                            <td>
                                    @member.Name
                            </td>
                            <td>
                                @member.AccountNo
                            </td>
                            <td>
                                @(DateTime.Now.Year - member.Birthday.Year)
                            </td>
                            <td>
                                @member.MobileNo
                            </td>
                            <td>
                                @member.LastLoginTime.ToShortDateString()
                            </td>
                            <td>
                                @if (member.PersonalMemberState == 1)
                                {
                                    <a href="javascript:void(0)" onclick="openTab('编辑会员信息','/Account/EditPersonalMember?UserID=@member.UserID',true)">
                                        编辑</a>
                                    <a href="javascript:void(0)" onclick="deletePersonalMember(@member.UserID)" >删除</a>
                                    <a href="javascript:void(0)" onclick="disablePersonalMember(@member.UserID)" >禁用</a>
                                }
                                else if (member.PersonalMemberState == 2)
                                {
                                    <a href="javascript:void(0)" onclick="enablePersonalMember(@member.UserID)" >启用</a>
                                }
                                else
                                {<a href="javascript:void(0)" onclick="enablePersonalMember(@member.UserID)" > 启用</a>}
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
            @Html.RenderPageNav(Model.PageIndex, Model.PageSize, Model.RowCount, "", PageNavStyle.Form)
        </div>
    </div>
    </form>
</body>
</html>
